home *** CD-ROM | disk | FTP | other *** search
/ Windows 6-Pak - Disc 4 / Windows 6-Pak (InfoMagic) (Disc 4) (1999).ISO / Text-Chat-Scripts / pp-320m.exe / pp300 / a-intrn2.mrc < prev    next >
Encoding:
Text File  |  1998-10-10  |  28.7 KB  |  553 lines

  1. ; -----------------------------------------------------
  2. ; Peace and Protection (by misspai)
  3. ; -----------------------------------------------------
  4. ; Internal aliases (basic) (2/2)
  5. ; -----------------------------------------------------
  6. _direxpop {
  7.   set %.num $_numtok(59,$2-)
  8.   set %.cur 1
  9.   :loop
  10.   set %.var _^ $+ %.cur $+ $1
  11.   set % [ $+ [ %.var ] ] $_a2x($gettok($2-,%.cur,59))
  12.   if ($_vi(.cur) <= %.num) goto loop
  13. }
  14. _clist .raw list > $+ $_i($1)
  15. _cprotpop {
  16.   set %.^whois $_setting(whois.onjoin,$active)
  17.   if (%.^whois == on) { set %.^whois $true | set %.^whoison $true | set %.^whoisop $false | set %.^whoisoff $false }
  18.   elseif (%.^whois == op) { set %.^whois $true | set %.^whoison $false | set %.^whoisop $true | set %.^whoisoff $false }
  19.   else { set %.^whois $false | set %.^whoison $false | set %.^whoisop $false | set %.^whoisoff $true }
  20.   set %.^ops $_setting(+nofloodkick.ops,$active)
  21.   set %.^vocs $_setting(+nofloodkick.vocs,$active)
  22.   unset %.^cs*
  23.   set %.len $len(%chanscan.default)
  24.   :loop | set %.^cs [ $+ [ $mid(%chanscan.default,%.len,1) ] ] $true | dec %.len | if (%.len > 0) goto loop
  25.   set %.var $active $+ .1
  26.   set %_^ab1 %autobot. [ $+ [ %.var ] ]
  27.   set %.var $active $+ .2
  28.   set %_^ab2 %autobot. [ $+ [ %.var ] ]
  29.   set %.var $active $+ .3
  30.   set %_^ab3 %autobot. [ $+ [ %.var ] ]
  31.   if (join isin %autobot. [ $+ [ $active ] ] ) set %.^csy $true
  32. }
  33. ; Cleanup if something's weird
  34. flush {
  35.   if ($1 != $null) { flush $1- | return }
  36.   if ($server == $null) _error /flush is only to clean up when a problem occurs WHILE connected.
  37.   _gen-icf
  38.   set %self.lag ??
  39.   set %leech.cmd.mask $_ppcfg(Sound,LeechCmd) *
  40.   if (%leech.cmd.mask == *) unset %leech.cmd.mask
  41.   if ($usermode != +) umode - $+ $remove($usermode,+)
  42.   if (%_oldnick != $null) urn
  43.   set %_sndchange y | _dirstrucpop
  44.   set %.test 0 0 0 0
  45.   if (%pp.flood == %.test) .flood off
  46.   else { .flood on | .flood %pp.flood }
  47.   unset %-* %s^* %_edf.*
  48.   .enable #+*
  49.   .disable #-*
  50.   set %.mode $remove(%default.umode,+)
  51.   if (%+mode.s) set %.mode %.mode $+ s
  52.   if (%+mode.w) set %.mode w $+ %.mode
  53.   if (%.mode != $null) umode + $+ %.mode
  54.   _remcfg counter-c
  55.   if (%_ignoreall) disps %col.att $+ Disabling ignore-all... | .ignore -r * | unset %_ignoreall
  56.   .timer904 1 $calc(%self.ping.time1 + %self.ping.time2 + 3) _qsp Q
  57.   .timer907 0 10 _chkidle
  58.   _timer924on
  59.   if ((efnet isin $server) || ((irc isin $server) && (2.8 isin %_server.ver) && (%_server.start == hcc))) set %pp.net EFnet
  60.   else {
  61.     set %.st.dots $count($server,.) $+ -
  62.     set %pp.net $remove($gettok($server,%.st.dots,46),.)
  63.     if ($right(%pp.net,3) isin org-com) set %pp.net $_lchop(3,%pp.net)
  64.     else set %pp.net $replace(%pp.net,net,Net)
  65.     set %pp.net $upper($left(%pp.net,1)) $+ $_rchop(1,%pp.net)
  66.     if (%pp.net == dalnet) set %pp.net DALnet
  67.   }
  68.   if ((%pp.net == dalnet) || (%pp.net == undernet)) set %_max.mode 6
  69.   else set %_max.mode 4
  70.   if (%pp.net == undernet) { _popxw | auto xpq }
  71.   if ((%pp.net == dalnet) || (%pp.dodal)) { _popdal | auto cpq | if ($_not(%+nickserv.onlyifwarn)) auto npq }
  72.   set %lastconnect $server $port
  73.   _trackcode
  74.   if ((%+awaylog.on) && (%_away.why != $null)) _awaylogback !
  75.   .disable #_awaylog #_inputhalt #_rawhalts #_fkeysound
  76.   .enable #^fkeynorm
  77.   if ($_not(%+accept.ebeeps.away)) .ebeeps on
  78.   unset %_away.* %_+awaywords.active
  79.   set %+pager %+pager.here
  80.   if (($me != %back.nick) && (%back.nick != $null)) nick %back.nick
  81.   unset %back.nick
  82.   _title
  83. }
  84. _popxw set %s^x Use X | set %s^w Use W | set %s^xw X or W | set %s^xwban Add bans to X/W...
  85. _popdal set %s^n NickServ | set %s^m MemoServ | set %s^mm MemoServ... | set %s^c ChanServ | set %s^csban Add bans to ChanServ...
  86. _dirstrucpop {
  87.   if ($chan($active) == $active) set %.chanp Settings for $active $+ ...
  88.   else unset %.chanp*
  89.   if (%_sndchange == $null) return
  90.   unset %_sndchange
  91.   unset %_^*.*
  92.   _direxpop .mp $_mpdir
  93.   _direxpop .wav $_wavedir
  94.   _direxpop .mid $_mididir
  95.   set %.numi 5
  96.   :loop
  97.   set %.type $gettok(%soundfile.custom,%.numi,32)
  98.   set %_^t. [ $+ [ %.numi ] ] $_a2x(%soundfile. [ $+ [ %.type ] ] )
  99.   set %.dir %.type $+ Dir
  100.   _direxpop . $+ %.numi $_ppcfg(Sound,%.dir)
  101.   if ($_vd(.numi) > 0) goto loop
  102. }
  103. _usermpop {
  104.   unset %.^*
  105.   if (i isin $usermode) set %.^i $true
  106.   if (w isin $usermode) set %.^w $true
  107.   if (s isin $usermode) set %.^s $true
  108.   if (i isin %default.umode) set %.^i2 $true
  109. }
  110. _maskpop set %.^2 $address($snick($active,1),2) $+ ... | set %.^3 $address($snick($active,1),3) $+ ... | set %.^4 $address($snick($active,1),4) $+ ...
  111. ; -----------------------------------------------------
  112. ; Misc popups
  113. ; -----------------------------------------------------
  114. _ptimer1 if ($3 == $null) set %_arhelp _ptimer2 $1 do a $+ $2 | elseif ($2 == me) set %_arhelp _ptimer2 $1 describe $_s2c($3-) | else set %_arhelp _ptimer2 $1-2 $_s2c($3-) | _pentry _arhelp Number of times to repeat message?(Enter for infinite)
  115. _ptimer2 set %_arhelp _ptimer3 $1-4 | if ($4 == $null) set %_arhelp %_arhelp 0 | _askr _arhelp Seconds between repetitions?
  116. _ptimer3 set %_arhelp _ptimer4 $1-5 | _askr _arhelp Message to repeat?
  117. _ptimer4 if ($2 == do) set %.cmd $4 $5 $3 $6- | else set %.cmd $4 $5 $2-3 $6- | if ($1) set %.cmd %.cmd $!_antirep | _timer800 %.cmd
  118. _palarm1 if ($2 == $null) set %_arhelp alarm $1 $+ m | else set %_arhelp alarm $2 $+ m $1 | _askr _arhelp Alarm message?
  119. _palarm2 if ($2 == $null) set %_arhelp alarm $1 | else set %_arhelp alarm $2 $1 | _askr _arhelp Alarm message?
  120. _setkey if ($chan($1).key != $null) m $1 -k $chan($1).key | m $1 +k $2
  121. _pkick1 set %_arhelp $1-3 | _askr _arhelp Reason for kick?
  122. _pallbut set %_arhelp allbut $1-2 | _askr _arhelp Mass notice message?
  123. _cscanm if ($1 isin %chanscan.default) { set %chanscan.default $remove(%chanscan.default,$1) | dispa $2- will not be shown in default scan } | else { set %chanscan.default %chanscan.default $+ $1 | dispa $2- will be shown in default scan }
  124. _puscan if (* isin $2) clones $1-2 | else clones $1 * $+ $2 $+ *
  125. _pbot1e if (* isin $2) set %_arhelp _pbot2e $1-2 | else set %_arhelp _pbot2e $1 $_ppmask($2,3) | _askr _arhelp Password on bot?
  126. _pbot2e botlist a $1-2 $+ /eggy $3 | botlist c $1-2 $+ /eggy opme msg &bot& op &pw& | dispa Support for eggdrop %col.target $+ $1 $+  added.  Use /opme when unopped to request ops, assuming you don't have X, W, etc. access.
  127. _pbot1p if (* isin $2) set %_arhelp _pbot2p $1-2 | else set %_arhelp _pbot2p $1 $_ppmask($2,3) | _askr _arhelp Password you use with OPME to user?
  128. _pbot2p botlist a $1-3 | botlist c $1-2 opme ctcp &bot& opme &chan& &pw& | dispa Automated OPME support on user %col.target $+ $1 $+  added using botlist.  /opme when unopped to use, assuming you don't have X, W, etc. access.
  129. _pbot1 if (* isin $2) set %_arhelp _pbot2 $1-2 | else set %_arhelp _pbot2 $1 $_ppmask($2,3) | _askr _arhelp Password on bot?
  130. _pbot2 set %_arhelp _pbot3 $1-3 | _askr _arhelp Is bot an eggdrop or other bot you wish to have your password automatically said to when you initiate a DCC chat? (yes or no)
  131. _pbot3 if (y isin $4) botlist a $1-2 $+ /eggy $3 | else { set %_arhelp _pbot4 $1-3 | _askr _arhelp Is bot a "service" IE a bot you wish to have used even if NOT visible on the channel? (yes or no) } | dispa View botlist popups to add bot commands
  132. _pbot4 if (y isin $4) botlist a $1-2 $+ /service $3 | else botlist a $1-3 | dispa View botlist popups to add bot commands
  133. _pxwkick set %_arhelp $1- | _pentry _arhelp Reason?2
  134. _pxwban set %_arhelp _pxwban2 $1-3 | _askr _arhelp Hours to ban? (336 max)
  135. _pxwban2 set %_arhelp _msgxw $1 ban $1 $3 $4 $2 | _pentry _arhelp Reason?2
  136. _pxwban3 set %_arhelp _pxwban $1-2 | _askr _arhelp Mask to ban?
  137. _pxwban4 _pxwban $1 $3 $2
  138. _pxwlist if ($2 == $null) _msgxw $1 lbanlist $1 * | else _msgxw $1 lbanlist $1-2
  139. _pxwpass _msgxw $1 newpass $1 $2 | set %.old %autoxw. [ $+ [ $1 ] ] | if (%.old != $null) set %autoxw. [ $+ [ $1 ] ] $gettok(%.old,1,32) $_pwenc($2)
  140. _pxwfirst _msgxw $1 login $1 | _msgxw $1 newpass $1 $2
  141. _pxwadd set %_arhelp _pxwadd2 $1-2 | _askr _arhelp Address mask for new user?
  142. _pxwadd2 set %_arhelp _pxwadd3 $1-3 | _askr _arhelp Access level of new user?
  143. _pxwadd3 set %_arhelp _msgxw $1 adduser $1-4 | _askr _arhelp Password for user?
  144. _pxwacc set %_arhelp _msgxw $1 modinfo $1 access $2 | _askr _arhelp New access level for user?
  145. _pxwmat set %_arhelp _msgxw $1 modinfo $1 match $2 | _askr _arhelp New address mask for user?
  146. _pxwaop _msgxw $1 modinfo $1 autoop $3 $2
  147. _pxwsus set %_arhelp _pxwsus2 $1-3 | _askr _arhelp Nickname or address of user to suspend?
  148. _pxwsus2 _msgxw $1 suspend $1 $4 $3 $2
  149. _pxwsus3 _msgxw $1 suspend $1-2 $4 $3
  150. _pxwget _msgxw $2 login $1 | _msgxw $2 newpass $1 $3 | .timer 1 5 _msgxw $2 join $1 | .timer 1 10 _msgxw $2 addchan $1 | set %_arhelp auto $2 $+ a $1 $3 | _askyn _arhelp Add an automatic $2 login for $1 $+ ?
  151. _pxwmpass set %_arhelp _msgxw $1 modinfo $1 password $2 | _askr _arhelp New password for user?
  152. _pqign set %_arhelp _pqign2 $1-4 | _pentry _arhelp Message to send user?1
  153. _pqign2 {
  154.   if ($3 == x) unset %.time | elseif ($3 == s) set %.time u $+ $4 | else set %.time u $+ $calc($4 * 60)
  155.   if ($1 == 3) set %.time c $+ %.time | ignore -pntik $+ %.time $2 3
  156.   if ($1 == 1) {
  157.     if ($5 == $null) unset %.msg | else set %.msg ( $+ $5- $+ )
  158.     if ($3 == x) msg $2 You are now being ignored. %.msg
  159.     elseif ($3 == s) msg $2 You are now being ignored for  $+ $4 $+  seconds. %.msg
  160.     else msg $2 You are now being ignored for  $+ $4 $+  minutes. %.msg
  161.   }
  162. }
  163. _psxwlogin if (%autoxw. [ $+ [ $2 ] ] != $null) auto xp $2 | else { set %_arhelp _msgxw $1 login $2 | _askr _arhelp Password? }
  164. _psxwpass1 set %_arhelp _psxwpass2 $1-2 | _askr _arhelp New password?
  165. _psxwpass2 _msgxw $1 newpass $2 $3 | set %.old %autoxw. [ $+ [ $2 ] ] | if (%.old != $null) set %autoxw. [ $+ [ $2 ] ] $gettok(%.old,1,32) $_pwenc($3)
  166. _psxwunbans {
  167.   set %.full $me $+ ! $+ %-my.address
  168.   if (%_recent.ban. [ $+ [ $2 ] ] iswm %.full) _msgxw $1 unban $2 %_recent.ban. [ $+ [ $2 ] ]
  169.   else {
  170.     _msgxw $1 unban $2 %.full
  171.     .timer 1 1 _msgxw $1 unban $2 $me $+ !*@*
  172.     .timer 1 2 _msgxw $1 unban $2 $mask(%.full,2)
  173.     .timer 1 3 _msgxw $1 unban $2 $mask(%.full,3)
  174.     .timer 1 4 _msgxw $1 unban $2 $mask(%.full,4)
  175.     if ($mask(%.full,4) != $_ppmask(%.full,4)) {
  176.       .timer 1 6 _msgxw $1 unban $2 $_ppmask(%.full,3)
  177.       .timer 1 7 _msgxw $1 unban $2 $_ppmask(%.full,4)
  178.     }
  179.   }
  180. }
  181. _psxwinvs _msgxw $1 invite $2 $me
  182. _psxwtopic set %_arhelp _msgxw $1 topic $2 | _askr _arhelp New topic?
  183. _psxwkick set %_arhelp _psxwkick2 $1-2 | _askr _arhelp User to kick?
  184. _psxwkick0 set %_arhelp _psxwkick2 $1-2 | _askr _arhelp Mask to kick?
  185. _psxwkick2 set %_arhelp _msgxw $1 kick $2-3 | _pentry _arhelp Kick reason?2
  186. _psxwban set %_arhelp _psxwban2 $1-2 | _askr _arhelp Nickname or mask to ban?
  187. _psxwban2 set %_arhelp _psxwban3 $1-3 | _askr _arhelp Hours to ban? (336 max)
  188. _psxwban3 set %_arhelp _psxwban4 $1-4 | _askr _arhelp Level of ban?
  189. _psxwban4 set %_arhelp _msgxw $1 ban $2-5 | _pentry _arhelp Reason?2
  190. _psxwunban set %_arhelp _msgxw $1 unban $2 | _askr _arhelp Mask to unban?
  191. _psxwop set %_arhelp _msgxw $1 op $2 | _askr _arhelp User(s) to op?
  192. _psxwdop set %_arhelp _msgxw $1 deop $2 | _askr _arhelp User(s) to deop?
  193. _ptban1 set %_arhelp _sell3 $1 kb0 -u $+ $calc($2 * $3) $1 | _pentry _arhelp Reason for tempban?1
  194. _extractp set %.form %ping.format | if (%+ping.sorted == $false) set %.form &ts& * $remove(%.form,&ts&) | return $gettok($2-,$findtok($strip(%.form),$1,32),32)
  195. _ptarget {
  196.   if ($line(@Ping,0) == 1) { if ($1 == d) dline @Ping 1 | return $strip($_extractp(&nick&,$line(@Ping,1))) }
  197.   set %.pt.num $sline(@Ping,0)
  198.   if (%.pt.num == 0) halt
  199.   unset %.pt.nick
  200.   :loop
  201.   set %.pt.nick %.pt.nick $_extractp(&nick&,$sline(@Ping,%.pt.num))
  202.   if ($1 == d) dline @Ping $sline(@Ping,%.pt.num).ln
  203.   if ($_vd(.pt.num) > 0) goto loop
  204.   return $strip($_s2c(%.pt.nick))
  205. }
  206. _pcsreg set %_arhelp _pcsreg2 $1-2 | _askr _arhelp Description of channel?
  207. _pcsreg2 _msgcs register $1- | set %_arhelp auto ca $1 $2 | _askyn _arhelp Add an automatic ChanServ login for $1 $+ ?
  208. _pcspw _msgcs set $1 passwd $2 | set %.old %autocs. [ $+ [ $1 ] ] | if (%.old != $null) set %autocs. [ $+ [ $1 ] ] $_pwenc($2)
  209. _pcsfl if (%autocs. [ $+ [ $1 ] ] != $null) auto cp $1 | else { set %_arhelp _msgcs identify $1 | _askr _arhelp Password? }
  210. _pcsu1 _msgcs unban $1 me
  211. _pcsu2 _msgcs unban $1 all
  212. _pnspass _msgns set passwd $1 | set %.old %autonk. [ $+ [ $me ] ] | if (%.old != $null) set %autonk. [ $+ [ $me ] ] $_pwenc($1)
  213. _pnsreg _msgns register $1 | set %_arhelp auto na $me $1 | _askyn _arhelp Add an automatic NickServ login for $me $+ ?
  214. _pnsrec set %.old %autonk. [ $+ [ $1 ] ] | if (%.old != $null) _msgns recover $1 %.old | else { set %_arhelp _msgns recover $1 | _pentry _arhelp Password for $1 $+ ? }
  215. _pnsrel set %.old %autonk. [ $+ [ $1 ] ] | if (%.old != $null) _msgns release $1 %.old | else { set %_arhelp _msgns release $1 | _pentry _arhelp Password for $1 $+ ? }
  216. _pnsghost set %.old %autonk. [ $+ [ $1 ] ] | if (%.old != $null) _msgns ghost $1 %.old | else { set %_arhelp _msgns ghost $1 | _pentry _arhelp Password for $1 $+ ? }
  217. _psmemo set %_arhelp _msgms send $1 | _askr _arhelp Memo to send to $1 $+ ?
  218. _psmemo2 set %_arhelp _msgms sendsop $1 | _askr _arhelp Memo to send to SOPs of $1 $+ ?
  219. _psmemf set %.old %autonk. [ $+ [ $1 ] ] | if (%.old != $null) _msgms forward $1 %.old | else { set %_arhelp _msgms forward $1 | _askr _arhelp Password for $1 $+ ? }
  220. _preae if (%pp.aech) set %.ch # | else unset %.ch
  221. ; -----------------------------------------------------
  222. ; Nicklist controls
  223. ; -----------------------------------------------------
  224. _sell1 set %.s1.max $snick($1,0) | if (%.s1.max > 0) { set %.s1.num 1 | :loop | $2 $snick($1,%.s1.num) $3- | if ($_vi(.s1.num) <= %.s1.max) goto loop }
  225. _sell2 set %.s2.max $snick($1,0) | if (%.s2.max > 0) { set %.s2.num 1 | :loop | $2-3 $snick($1,%.s2.num) $4- | if ($_vi(.s2.num) <= %.s2.max) goto loop }
  226. _sell12 set %.s2.max $snick($1,0) | if (%.s2.max > 0) { set %.s2.num 1 | :loop | $2 $snick($1,%.s2.num) $snick($1,%.s2.num) $3- | if ($_vi(.s2.num) <= %.s2.max) goto loop }
  227. _sell3 set %.s2.max $snick($1,0) | if (%.s2.max > 0) { set %.s2.num 1 | :loop | $2-4 $snick($1,%.s2.num) $5- | if ($_vi(.s2.num) <= %.s2.max) goto loop }
  228. _sellX set %.s2.max $snick($1,0) | if (%.s2.max > 0) { set %.s2.num 1 | :loop | $3-4 $_ppmask($snick($1,%.s2.num),$2) $5- | if ($_vi(.s2.num) <= %.s2.max) goto loop }
  229. ; $_soundmsg(plays,$false,filename.mp3) ($true to ask for description if none exists)
  230. _soundmsg {
  231.   set %.gm.desc $_ppdesc($nopath($3-))
  232.   if (%.gm.desc == (none)) unset %.gm.desc
  233.   set %.gm.leech $_ppcfg(Sound,LeechCmd) $nopath($3-)
  234. if (($_ppcfg(Sound,LeechShow)) && ($_rtok(1,46,$nopath($3-)) isin $_ppcfg(Sound,LeechTypes))) {
  235.     if (%.gm.desc == $null) set %.gm.ret $_getmsg(SoundMsg,MessageLeech)
  236.     else set %.gm.ret $_getmsg(SoundMsg,MessageDescLeech)
  237.   }
  238.   else {
  239.     if (%.gm.desc == $null) set %.gm.ret $_getmsg(SoundMsg,Message)
  240.     else set %.gm.ret $_getmsg(SoundMsg,MessageDesc)
  241.   }
  242.   if (%.gm.desc == $null) set %.gm.desc (no desc.)
  243.   set %.ret $_finalmsg($replace($replace($replace($replace($replace(%.gm.ret,&file&,$_sfext($nopath($3-))),&size&,$_size($lof($3-))),&leech&,%.gm.leech),&desc&,%.gm.desc),&play&,$_p2s($1)))
  244.   return %.ret
  245. }
  246. ; -----------------------------------------------------
  247. ; Group disables
  248. ; -----------------------------------------------------
  249. _slowpre dispa Disabling unneeded "slow" features... | unset %.did
  250. _slow1 {
  251.   if (%+nickcolors) {
  252.     set %+nickcolors $false
  253.     set %.ch $chan(0)
  254.     if (%.ch > 0) {
  255.       :loop1
  256.       set %.chn $chan(%.ch)
  257.       set %.nk $nick(%.chn,0)
  258.       :loop2
  259.       cline $colour(listbox text) %.chn %.nk
  260.       if ($_vd(.nk) > 0) goto loop2
  261.       if ($_vd(.ch) > 0) goto loop1
  262.     }
  263.     dispa Disabled %col.dark $+ "Color nicklist"
  264.     set %.did $true
  265.   }
  266.   if ($group(#lastseen) == on) { .disable #lastseen | dispa Disabled %col.dark $+ "Record last seen data" | set %.did $true }
  267.   if (%+clonescan.youjoin) { set %+clonescan.youjoin $false | dispa Disabled %col.dark $+ "Scan for clones when you join a channel" | set %.did $true }
  268.   if (%+blackscan.youop) { set %+blackscan.youop $false | dispa Disabled %col.dark $+ "Scan for blacklisted users when you are opped" | set %.did $true }
  269.   if (%+joinstat) { set %+joinstat $false | dispa Disabled %col.dark $+ "Show any kickstats for a user when they join" | set %.did $true }
  270.   _slowprot max.caps 0 Caps Flood
  271.   _slowprot max.capperc 0 Caps Abuse
  272.   _slowprot +acton.badidentd $false Invalid Identd
  273.   _slowprot match.wordkick $null Word Kicks
  274. }
  275. _slow2 {
  276.   if (%+colorflood.check) { set %+colorflood.check $false | dispa Disabled %col.dark $+ "On extreme color flood, ignore colors to prevent 'screen lag'" | set %.did $true }
  277.   if (%+awaywords.on) { set %+awaywords.on $false | dispa Disabled %col.dark $+ "If user says an awayword in channel send notice that you are away" | set %.did $true }
  278.   if (%+blackscan.nick) { set %+blackscan.nick $false | dispa Disabled %col.dark $+ "When user changes nick, check to see if new nick is blacklisted" | set %.did $true }
  279.   if (%+ircop.check) { set %+ircop.check $false | dispa Disabled %col.dark $+ "Check for and warn when a user joining a channel is an IRCop" | set %.did $true }
  280.   if ($group(#activitylog) == on) { .disable #activitylog | dispa Disabled %col.dark $+ "Log channel activity (modes, etc.) to ACTIVITY.LOG" | set %.did $true }
  281.   if ($group(#voiceautosync) == on) { .disable #voiceautosync | dispa Disabled %col.dark $+ "Auto sync userlist if voiced then deopped" | set %.did $true }
  282.   if ($group(#whitetxt) == on) { .disable #whitetxt | dispa Disabled %col.dark $+ "Show you text people type in your background color" | set %.did $true }
  283.   _slowprot max.pcode 0 Attribute Abuse
  284.   _slowprot max.codeflood 0 Attribute Flood
  285.   _slowprot max.repeat 0 Repeating
  286.   _slowprot max.revolve 0 Revolving Door
  287. }
  288. _slowend {
  289.   if (%.did) dispa All features in selected category disabled
  290.   else dispa No features in selected category were enabled, so none could be disabled.
  291. }
  292. _slowprot {
  293.   if (% [ $+ [ $1 ] ] != $2) { set % [ $+ [ $1 ] ] $2 | dispa Disabled global protection for %col.dark $+ " $+ $3- $+ " | set %.did $true }
  294.   set %.ch $chan(0)
  295.   if (%.ch > 0) {
  296.     :loop
  297.     set %.chn $chan(%.ch)
  298.     set %.var $1 $+ . $+ %.chn
  299.     if (% [ $+ [ %.var ] ] != $2) { set % [ $+ [ $1 ] ] $2 | dispa Disabled protection for %col.dark $+ " $+ $3- $+ " on %col.target $+ %.chn | set %.did $true }
  300.     if ($_vd(.ch) > 0) goto loop
  301.   }
  302. }
  303. ; ---
  304. _firsttime {
  305.   set %_req.col 10
  306.   close -@
  307.   window -ardol +f @First $_center(530,340,d) 530 340 /_first2 Arial 16
  308.   titlebar @First time setup
  309.   aline @First Since this is your first time running Peace and Protection 3.20, you will be
  310.   aline @First directed to first-time setup. You should only skip this setup if you know
  311.   aline @First how to set up mIRC and P&P correctly by hand or if the setup causes
  312.   aline @First problems for some reason.
  313.   aline @First $chr(160)
  314.   aline @First The setup optionally includes a full scan of ALL hard drives to search for
  315.   aline @First previous copies of mIRC and P&P to import settings, and to search for
  316.   aline @First sound files to setup sound directories easily. This scan may be undesired
  317.   aline @First if your computer is on a network or has many drives, and can be skipped.
  318.   aline @First $chr(160)
  319.   aline @First Please select one: (double-click on an option)
  320.   aline -s @First * Perform full setup procedures including drive scan
  321.   aline @First * Perform setup but skip drive scan
  322.   aline @First * Perform setup and perform a partial drive scan on drives you specify
  323.   aline @First * Skip first-time setup procedures entirely
  324.   aline @First * Exit P&P without selecting a setup option
  325.   if ($1 isnum 12-14) {
  326.     if ($1 == 13) sline @First 15 | else sline @First 13
  327.     rline @First 1 $chr(160)
  328.     rline @First 2 P&P setup failed to complete correctly last time. Consider choosing
  329.     rline @First 3 the selected option to avoid problems that may have occured.
  330.     rline @First 4 $chr(160)
  331.   }
  332.   .timer927 -m 0 100 _chk1st
  333.   halt
  334. }
  335. _chk1st if (($window(@First).state != normal) || ($active != @First)) _firsttime
  336. _reqparam .timer927 off | .timer -om 1 1 _reqparam2 $1- | halt
  337. _reqparam2 window -c @Question | .timer -om 1 1 _reqparam3 $1- | halt
  338. _reqparam3 {
  339.   window -ardoe +f @Question $_center(527,160,d) 527 160 Arial 16
  340.   set %_preq.p $1-
  341.   set %.pe.max $_numtok(127,$2-)
  342.   set %.pe.num 1
  343.   :loop
  344.   echo %_req.col @Question  $+ $gettok($2-,%.pe.num,127)
  345.   if ($_vi(.pe.num) <= %.pe.max) goto loop
  346.   if ( isin $1) editbox @Question $_p2s($gettok($1,2-,127))
  347.   else editbox @Question $chr(160)
  348.   set %_preq.c $gettok($1,1,127)
  349.   .timer927 -m 0 100 _chkreq
  350.   halt
  351. }
  352. _chkreq if (($window(@Question).state != normal) || ($active != @Question)) _reqparam %_preq.p
  353. _first2 {
  354.   .timer927 off
  355.   set %pp.setuptype $sline(@First,1).ln
  356.   if (%pp.setuptype < 12) halt
  357.   window -c @First
  358.   if (%pp.setuptype < 15) {
  359.     flushini variable.mrc
  360.     set %.ini $_ppdir $+ first.ini
  361.     if ($bits == 16) {
  362.       if ($exists(mirc2.exe)) run mirc2.exe -i $+ %.ini
  363.       else {
  364.         .copy mirc.exe mirc2.exe
  365.         run mirc2.exe -i $+ %.ini
  366.       }
  367.     }
  368.     else {
  369.       run mirc32.exe -i $+ %.ini
  370.     }
  371.   }
  372.   if (%pp.setuptype == 15) { _2ndtime | _dostartup }
  373.   else exit
  374. }
  375. _2ndtime {
  376.   if ($bits == 16) .remove mirc2.exe
  377.   set %pp.first no | unset %pp.setuptype
  378.   .flood on | .flood 350 30 3 0 | .ial on | .remote on | .dlevel 1
  379.   .pdcc 200000 | .dcc packetsize 4096 | .fsend on
  380.   notify -aq misspai *!*goddess@*
  381.   unset %^nick.* | if ($me != $null) _dynpop.rot nick 8 $me | else _dynpop.rot nick 8 WhyNoNick
  382.   set %pp.ver v3.20.b
  383.   _gen-icf
  384.   about
  385.   disps-div
  386.   disps Welcome to %col.target $+ Peace and Protection %pp.ver $+ !
  387.   disps Right-click in this window to connect to a server, or press %col.option $+ Alt+E for mIRC's server dialog.
  388.   disps Right-click in any window for commands. See the P&P Tools menu for options/help. ( $+ %col.option $+ Alt+Q)
  389.   disps Select "Help" from any menu for help, or type %col.option $+ /pp to browse P&P help.
  390.   disps You can also select "Peacepro.hlp" from the Help menu.
  391.   disps-div
  392.   disps If you wish to use P&P's e-mail features, type %col.option $+ /addon to install the e-mail addon.
  393.   disps-div
  394.   disps Make sure you type %col.option $+ /protedit to edit channel protection settings or at least to view the default
  395.   disps settings. You may want to disable text flood protection entirely or make other changes.
  396.   disps-div
  397. }
  398. ; ---
  399. _mapext set %.mext $findtok(%soundfile.extmap1,$1,32) | if (%.mext == $null) return $1 | return $gettok(%soundfile.extmap2,%.mext,32)
  400. _maprev {
  401.   set %.ret $2- $+ $1
  402.   set %.tokp 1
  403.   :loop
  404.   set %.tok $findtok(%soundfile.extmap2,$1,%.tokp,32)
  405.   if (%.tok != $null) {
  406.     set %.ret %.ret $+ ; $+ $2- $+ $gettok(%soundfile.extmap1,%.tok,32)
  407.     inc %.tokp | goto loop
  408.   }
  409.   return %.ret
  410. }
  411. _avoidflood {
  412.   if (%+nickchange.flood) {
  413.     _timersinc 60 -floodchanged
  414.     if (%-floodchanged < 2) rn
  415.   }
  416.   if ((%+ignoreflood) || (%+silenceflood) || ((%+ignoreflood.ifnotchan) && ($me !isop $chan)) || ((%+silenceflood.ifnotchan) && ($me !isop $chan))) {
  417.     ignore -tniu60 $wildsite
  418.     if ((%+silenceflood) || ((%+silenceflood.ifnotchan) && ($me !isop $chan))) { .raw silence + $+ $wildsite | .timer 1 60 .raw silence - $+ $wildsite }
  419.   }
  420. }
  421. ; Call- _kick.mc.flood caps CapsFlood 10 50 (type, then kick name, then &num& and &secs&)
  422. _kick.mc.flood {
  423.   if ($1 == topic) {
  424.     if (t !isin $chan($chan).mode) .raw mode $chan +t
  425.   }
  426.   else {
  427.     if (n !isin $chan($chan).mode) .raw mode $chan +n
  428.   }
  429.   _prog.punish $1 $2 $3 $4 $chan $nick $nick $site
  430. }
  431. ; -----------------------------------------------------
  432. ; CTCP editor
  433. ; -----------------------------------------------------
  434. ctcpedit {
  435.   window -c @CTCP
  436.   set %.ce.file $_ppdir $+ config.ini
  437.   set %.ce.num $lines(%.ce.file)
  438.   :loop1
  439.   set %.ce.txt $read -nl [ $+ [ %.ce.num ] ] %.ce.file
  440.   if (%.ce.txt != [CTCP]) if ($_vd(.ce.num) > 0) goto loop1
  441.   :found
  442.   window -l $_tabscale(9) @CTCP $_winpos(7%,7%,14%,14%) @CTCP %font.basic
  443.   titlebar @CTCP editor
  444.   aline @CTCP Double-click on a line to edit that CTCP reply.
  445.   aline @CTCP (note- any ping reply is a notice to send when you are pinged)
  446.   aline @CTCP %=
  447.   if (%.ce.num > 0) {
  448.     :loop2
  449.     inc %.ce.num
  450.     set %.ce.ctcp $read -nl [ $+ [ %.ce.num ] ] %.ce.file
  451.     if ((%.ce.ctcp != $null) && (= isin %.ce.ctcp)) {
  452.       set %.ce.targ $gettok(%.ce.ctcp,2-,61)
  453.       set %.ce.ctcp $gettok(%.ce.ctcp,1,61)
  454.       if ($left(%.ce.targ,8) == !Random:) aline @CTCP %col.target $+ %.ce.ctcp $+      $+ %col.dark $+ Random selection from file: %col.target $+ $gettok(%.ce.targ,2-,58)
  455.       else aline @CTCP %col.target $+ %.ce.ctcp $+      $+ %.ce.targ
  456.       goto loop2
  457.     }
  458.   }
  459.   aline @CTCP %=
  460.   aline @CTCP Double-click here to add a new CTCP reply
  461.   aline @CTCP Right-click to delete replies, set defaults, or select randomly from a file.
  462.   window -b @CTCP
  463. }
  464. _ce.sel {
  465.   if ($1 < 4) return
  466.   set %.ce.max $line(@CTCP,0)
  467.   if (($1 == %.ce.max) || ($1 == $calc(%.ce.max - 2))) return
  468.   if ($1 == $_j(%.ce.max)) {
  469.     if ($2 == $null) { set %_arhelp _ce.sel $1 | _askr _arhelp New CTCP to reply to? }
  470.     if ($3 == $null) { set %_arhelp _ce.sel $1 $2 | _askr _arhelp Reply to send to $2 CTCPs? }
  471.     _writecfg CTCP $2 $3-
  472.     iline @CTCP $calc($1 - 1) %col.target $+ $2 $+      $+ $3-
  473.   }
  474.   else {
  475.     set %.ce.line $line(@CTCP,$1)
  476.     set %.ce.ctcp $strip($gettok(%.ce.line,1,9))
  477.     if ($2 == $chr(160)) {
  478.       _writecfg CTCP %.ce.ctcp
  479.       dline @CTCP $1
  480.     }
  481.     elseif ($2 == !) {
  482.       set %.ce.def $_ppdef(CTCP,%.ce.ctcp)
  483.       if (%.ce.def != $null) {
  484.         _writecfg CTCP %.ce.ctcp %.ce.def
  485.         rline @CTCP $1 %col.target $+ %.ce.ctcp $+      $+ %.ce.def
  486.       }
  487.     }
  488.     elseif ($2 == ?) {
  489.       _timer924off
  490.       set %.ce.got $dir="File to select random replies from?" [ [ $mircdir ] $+ ] *.txt
  491.       _timer924on
  492.       if ((%.ce.got == $null) || (* isin %.ce.got)) return
  493.       set %.ce.got $remove(%.ce.got,$mircdir)
  494.       _writecfg CTCP %.ce.ctcp !Random: $+ %.ce.got
  495.       rline @CTCP $1 %col.target $+ %.ce.ctcp $+      $+ %col.dark $+ Random selection from file: %col.target $+ %.ce.got
  496.     }
  497.     else {
  498.       if ($2 == $null) {
  499.         set %_arhelp _ce.sel $1
  500.         if (*Random*selection* iswm $gettok(%.ce.line,2-,9)) _askr _arhelp Reply to send to %.ce.ctcp CTCPs?
  501.         else _pentry _arhelp $+ $_s2p($gettok(%.ce.line,2-,9)) Reply to send to %.ce.ctcp CTCPs?
  502.       }
  503.       _writecfg CTCP %.ce.ctcp $2-
  504.       rline @CTCP $1 %col.target $+ %.ce.ctcp $+      $+ $2-
  505.     }
  506.   }
  507. }
  508. ;----
  509. rad {
  510.   set %pp.whois $_winpos(14%,7%,7%,9%)
  511.   set %pp.ping $_winpos(14%,7%,9%,7%)
  512. }
  513. _chands {
  514.   if (($1 != $server) && ($3 ischan)) {
  515.     if (($me !isop $3) && ($2 == o)) return
  516.     if (($4 != $null) && ($4 !ison $3)) return
  517.     disprs $3 [[ $+ %col.info1 $+ $lower($3) $+ ] Possible channel desynch detected
  518.   }
  519. }
  520. _ULhelp {
  521.   window @Userlist $_winpos(50%,7%,7%,7%) @Userlist
  522.   window -c @Userlevel
  523.   window -arl $_tabscale(7,13) @Userlevel $_winpos(7%,50%,7%,7%) @Userlevel %font.basic
  524.   titlebar @Userlevel help
  525.   aline @Userlevel Basic level     $+ %col.att $+ 1    No special access
  526.   aline @Userlevel Basic level     $+ %col.att $+ 50    Script will not deop/kick/ban this user automatically
  527.   aline @Userlevel Basic level     $+ %col.att $+ 75    Script will punish others who deop/kick/ban this user
  528.   aline @Userlevel Basic level     $+ %col.att $+ 175    User can control your computer with DO CTCPs, obviously not for general use
  529.   aline @Userlevel Sub-level     $+ %col.att $+ chat    DCC chats from this user are automatically accepted
  530.   aline @Userlevel Sub-level     $+ %col.att $+ send    DCC sends from this user are automatically accepted
  531.   aline @Userlevel Sub-level     $+ %col.att $+ nodcc    All DCCs from this user are ignored
  532.   aline @Userlevel Sub-level     $+ %col.att $+ voice    This user will be automatically voiced where you have ops
  533.   aline @Userlevel Sub-level     $+ %col.att $+ nopw    This user will be auto opped w/o using a password (channels you specify)
  534.   aline @Userlevel Sub-level     $+ %col.att $+ color##    This user will be that color in your nicklist (if you have nicklist colors enabled)
  535. }
  536. _pumode {
  537.   set %.mode $_fixmode($1)
  538.   disp User mode(s)  $+ %.mode $+  set by default when signing on.
  539.   set %.len $len(%.mode) | set %.pos 1
  540.   :loop
  541.   set %.jib $mid(%.mode,%.pos,2) | if (%.jib == $null) halt
  542.   if ($left(%.jib,1) == -) set %.t $false | else set %.t $true
  543.   set %.jib $right(%.jib,1)
  544.   if (%.jib == s) set %+mode.s %.t
  545.   elseif (%.jib == w) set %+mode.w %.t
  546.   else {
  547.     set %default.umode $remove(%default.umode,%.jib)
  548.     if (%.t) set %default.umode %default.umode $+ %.jib
  549.   }
  550.   inc %.pos 2
  551.   goto loop
  552. }
  553.